import request from '@/router/axios';
import config from '@/config/website'


//列表
export const quotaList = (current, size, mold) => {
  return request({
    url: '/api/blade-basic/quota/list',
    method: 'get',
    params: {
      current,
      size,
      ...mold
    }
  })
}
//添加
export const quotaAdd = (mold) => {
  return request({
    url: '/api/blade-basic/quota/save',
    method: 'post',
    data: mold
  })
}

//编辑时获取数据
export const quotaDetail = (id) => {
  return request({
    url: '/api/blade-basic/quota/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//编辑
export const quotaUpdate = (mold) => {
  return request({
    url: '/api/blade-basic/quota/update',
    method: 'post',
    data: mold
  })
}
//删除
export const removequota = (ids) => {
  return request({
    url: '/api/blade-basic/quota/remove',
    method: 'get',
    params: {
      ids,
    }
  })
}

//获取产品下拉选
export const getProductList = () => {
  return request({
    url: '/api/blade-basic/quality/part/allPart',
    method: 'get',
  })
}

//获取定额产品下拉选
export const getNewProductList = () => {
  return request({
    url: '/api/blade-basic/quality/part/newPart',
    method: 'get',
  })
}


//获取原材料下拉选
export const getMaterialList = () => {
  return request({
    url: '/api/blade-basic/quota/material',
    method: 'get',
  })
}
//产品主数据导入
export const productInforImport = (fileUrl) => {
  return request({
    url: '/api/human-resources/personnel/personnelInfo/importFile',
    method: 'get',
    params: {
      fileUrl
    }
  })
}

//导出
export const quotaExport = (ids) => {
  window.location = `${config.exportUrl}/human-resources/organization/consolidation/ExportExcel?ids=${ids}`;
}
